package cn.iocoder.yudao.module.system.tcpserver.protocol1;

import io.netty.channel.Channel;
import io.netty.util.concurrent.ScheduledFuture;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class HeartbeatServer {
    // 存储客户端ID与对应的Channel和定时任务
    private static final Map<String, ChannelSchedule> clientMap = new ConcurrentHashMap<>();

    static class ChannelSchedule {
        Channel channel;
        ScheduledFuture<?> future;

        ChannelSchedule(Channel channel, ScheduledFuture<?> future) {
            this.channel = channel;
            this.future = future;
        }
    }

    public static Map<String, ChannelSchedule> getClientMap() {
        return clientMap;
    }
}
